Re: [SQL] Typecasting within sql statement. - Mailing list pgsql-sql

From lynch@lscorp.com (Richard Lynch)
Subject Re: [SQL] Typecasting within sql statement.
Date
Msg-id v02140b1ab1c292ce630d@[207.152.64.133]
Whole thread Raw
Responses Re: [SQL] Typecasting within sql statement.  (Colin Dick <cdick@mail.ocis.net>)
List pgsql-sql
Try something like this:

update myTable set field = 42::text::varchar;

I think the int4 --> text converter is written, and text --> varchar is
written, but int4 --> varchar is not.

Basically, anytime you need to go from one type to another that doesn't
seem to have a converter, look for a more general intermediate type.

At least, that's my understanding after one fight with this. :-)

--
--
-- "TANSTAAFL" Rich lynch@lscorp.com



pgsql-sql by date:

Previous
From: Colin Dick
Date:
Subject: Typecasting within sql statement.
Next
From: Colin Dick
Date:
Subject: Re: [SQL] Typecasting within sql statement.